<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}

</head>

<body class="white-bg" style="overflow-x: auto!important;color:#333;padding:3px;">

<div class="ibox">
    <div class="page-heade">
       <h2 class="title_color text-center">批量更新网点所属行政区域</h2>
    </div>
        <div class="ibox-content">
            <a href="" class="btn btn-primary" id="id1">批量更新所有网点所属行政区域</a>
            <a href="" class="btn btn-primary" id="id2">批量更新所有上一次失败的网点所属行政区域</a>
        </div>
        <div class="ibox-content" id="ibox-content">
            <table class="table table-bordered table-hover" id="table1">
                <tr>
                    <th>No</th>
                    <th>网点</th>
                    <th>同步失败原因</th>
                    <th>同步人</th>
                    <th>同步时间</th>
                </tr>
                <tr>
                    <td>1</td>
                    <td>2</td>
                    <td>3</td>
                    <td>4</td>
                    <td>5</td>
                </tr>
            </table>
        </div>
    </div>

<!-- 全局js -->
{include file="Public/footer"}
    <script>
        $(function () {
            $('#id1').click(function () {
                $('#ibox-content').html('<iframe src="" frameborder="0"></iframe>')
                $.post(
                    '',
                    {type:1},
                    function (data) {
                        alert(data)
                        if(data.net_id){
                            $('#table1').append('<tr>\n' +
                                '                    <td>'+data.i+'</td>\n' +
                                '                    <td>'+data.net_id+'</td>\n' +
                                '                    <td>'+data.content+'</td>\n' +
                                '                    <td>'+data.cuser+'</td>\n' +
                                '                    <td>'+data.ctime+'</td>\n' +
                                '                </tr>')
                        }
                    },
                    'json')
                return false
            })
            $('#id2').click(function () {
                $.post('',{type:2},function (data) {
                    if(data.success){
                        parent.swal({
                            title:data.msg,
                            type:'error'
                        },function () {
                            location.reload()
                        })
                    }else
                        parent.swal(data.msg, "", "error");

                },'json')
                return false
            })
        })
    </script>
</body>

</html>